<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>css的fieldset和伪元素选择器</title>
    <style>
        li{
            list-style: none;
        }
        input:checked+span{
            background-color: aqua;
        }
        input:checked+span::after{
            content: '     （内容被选中）';
        }

    </style>
</head>
<body>
<fieldset>
    <legend>选择你喜欢的食物</legend>
    <ul>
        <li>
            <lable>
                <input type="radio" name="food">
                <span>螺蛳粉</span>
            </lable>
        </li>
        <li>
            <lable>
                <input type="radio" name="food">
                <span>桂林米粉</span>
            </lable>
        </li>
        <li>
            <lable>
                <input type="radio" name="food">
                <span>老友粉</span>
            </lable>
        </li>
        <li>
            <lable>
                <input type="radio" name="food">
                <span>叉烧粉</span>
            </lable>
        </li>
        <li>
            <lable>
                <input type="radio" name="food">
                <span>牛腩粉</span>
            </lable>
        </li>
        <li>
            <lable>
                <input type="radio" name="food">
                <span>螺蛳粉</span>
            </lable>
        </li>
        <li>
            <lable>
                <input type="radio" name="food">
                <span>猪脚粉</span>
            </lable>
        </li>
    </ul>
    </ul>
</fieldset>
<fieldset>
    <legend>选择你的爱好（可多选）</legend>
    <ul>
        <li>
            <lable>
                <input type="checkbox" name="hobby">
                <span>游泳</span>
            </lable>
        </li>
        <li>
            <lable>
                <input type="checkbox" name="hobby">
                <span>篮球</span>
            </lable>
        </li>
        <li>
            <lable>
                <input type="checkbox" name="hobby">
                <span>音乐</span>
            </lable>
        </li>
        <li>
            <lable>
                <input type="checkbox" name="hobby">
                <span>网球</span>
            </lable>
        </li>
        <li>
            <lable>
                <input type="checkbox" name="hobby">
                <span>看电影</span>
            </lable>
        </li>
        <li>
            <lable>
                <input type="checkbox" name="hobby">
                <span>跑步</span>
            </lable>
        </li>
        <li>
            <lable>
                <input type="checkbox" name="hobby">
                <span>看书</span>
            </lable>
        </li>
    </ul>
</fieldset>
</body>
</html>